import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

@Entity('miniprogram_configs')
export class MiniProgramConfig {
  @ApiProperty({ description: '配置ID' })
  @PrimaryGeneratedColumn()
  id: number;

  @ApiProperty({ description: '小程序AppID' })
  @Column({ length: 100, unique: true })
  appId: string;

  @ApiProperty({ description: '小程序Secret' })
  @Column({ length: 100 })
  secret: string;

  @ApiProperty({ description: '小程序名称' })
  @Column({ length: 100 })
  name: string;

  @ApiProperty({ description: '小程序描述' })
  @Column({ length: 500, nullable: true })
  description: string;

  @ApiProperty({ description: '状态：0-禁用，1-启用' })
  @Column({ default: 1 })
  status: number;

  @ApiProperty({ description: '创建时间' })
  @CreateDateColumn()
  createdAt: Date;

  @ApiProperty({ description: '更新时间' })
  @UpdateDateColumn()
  updatedAt: Date;
}
